<template>
  <div>
    <div class="config">
        <div class="back" onclick="window.history.go(-1)"><img src="../assets/images/back.png" alt=""></div>
        <p>我的证书</p>
    </div>
     <div class="con">
         <div class="bg1"></div>
         <div class="bg2"></div>
         <div class="zh"><img :src="card_url" alt="" class="zs"></div>
         
         <div class="title">我的证书</div>
     </div>


  </div>
</template>

<script>
export default {
    name: "index",
    data() {
        return {
            card_url:""
        };
    },
    beforeCreate() {
        document.getElementsByTagName("body")[0].style.background = "#5aa0c8";
    },
    mounted() {
        var qs = require("qs");
        this.axios({
            method: "post",
            url: `${this.siteUrl}/getCardPic`,
            data: qs.stringify({
                uid: localStorage.getItem("uid")
            })
        })
            .then(response => {                
                if ((response.data.result == 200)) {
                    this.card_url = response.data.data[0].card_url;
                } else {
                    alert("请求失败");
                }
            })
            .catch(function(error) {
                console.log(error);
            });
    }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.con {
    width: 100vw;
    height: 92vh;
    position: absolute;
    bottom: 0px;
    margin-top: 50px;
}

.con .bg1 {
    width: 90%;
    height: 70vh;
    background: #dae7ef;
    left: 5%;
    border-radius: 5px;
    position: absolute;
    top: 10%;
}
.con .bg2 {
    width: 86%;
    height: 72vh;
    background: #fff;
    left: 7%;
    border-radius: 5px;
    position: absolute;
    top: 9%;
}
.con .title {
    width: 40%;
    height: 50px;
    line-height: 50px;
    background: #fff;
    text-align: center;
    border-radius: 5px;
    color: #5aa0c8;
    position: absolute;
    top: 5%;
    left: 30%;
    box-shadow: 0px 0px 10px 0px #78abc8;
}
.con .zs {
    width: 78%;
    height: 70vh;
    background: #fff;
    left: 11%;

    position: absolute;
    top: 10%;
}
.con .zs img {
    width: 100%;
}
</style>
